import 'package:get/get_navigation/src/routes/default_route.dart';
import 'package:get/get_navigation/src/routes/get_route.dart';

import 'mine_bind.dart';
import 'mine_page.dart';

/// AppAddBmg 导航配置
///
/// 该类将[GetPage]暴露给[AppRoutes]用于集中配置APP的导航行为
///
/// 有关路由配置的使用详情可以阅读`project/readme/route_management.md`
class MineConf {
  static final GetPage getPage = GetPage(
      name: '/xykk/mine',
      page: () => const MinePage(),
      binding: MineBinding());

  static GetPageRoute? _pageRoute;

  /// 用于代码进行页面导航
  /// `Get.to()`
  // static Widget? getWidget(BuildContext context) {
  //   if (_pageRoute == null) {
  //     _pageRoute = getPage.createRoute(context) as GetPageRoute?;
  //   }
  //   return _pageRoute?.buildPage(context, null, null);
  // }

  /// 销毁创建的Page
  static void dispose() {
    _pageRoute?.dispose();
    _pageRoute = null;
  }
}
